<template>
<body>
<el-main style="width: 1200px;margin: 0 auto">
  <el-row gutter="20">
    <el-col span="12">
      <el-card>
        <img src="imgs/a.jpg" width="100%">
      </el-card>
    </el-col>
    <el-col span="12">
      <p style="font-size: 25px;font-weight: bold">{{p.title}}</p>
      <el-divider></el-divider>
      <p style="font-size: 15px;color: #666">销量:{{p.saleCount}}件 浏览量:{{p.viewCount}}</p>
      <p style="font-size: 15px;color:#666">
        库存:{{p.num}}件 发布于:{{p.created}}
      </p>
      <p style="font-size: 20px;font-weight: bold">
        ￥{{p.price}} <span style="font-size: 15px;color: #666">原价:<s>{{p.oldPrice}}</s></span>
      </p>
      <el-row gutter="10" style="text-align: center">
        <el-col span="8">
          <el-card>
            <img src="imgs/ewm.jpg" width="100%">
          </el-card>
          <p>扫码关注公众号</p>
        </el-col>
        <el-col span="8">
          <el-card>
            <img src="imgs/ewm.jpg" width="100%">
          </el-card>
          <p>扫码购买商品</p>
        </el-col>
        <el-col span="8">
          <el-card>
            <img src="imgs/ewm.jpg" width="100%">
          </el-card>
          <p>扫码下载App</p>
        </el-col>
      </el-row>
    </el-col>
  </el-row>
</el-main>
</body>
</template>
<style>
.el-header a{
  color: #666;
  text-decoration: none;
}
.el-menu.el-menu--horizontal{
  border-bottom: 0;
}
.el-table .el-table__cell{
  padding: 0;
}
</style>
<script>
export default {
  name: "Detail",
  data: function () {
    return {
      arr:[],
      p:{},
      wd:""
    }
  },
  methods:{
    handleSelect(key,keyPath){
      location.href="/result.html?id="+key;
    },
    search(){
      location.href="/result.html?wd="+v.wd;
    }
  },
  created: function () {
    /*获取所有分类*/
    axios.get("/category/select").then(function (response) {
      v.arr = response.data;
    })
    /*获取商品详情信息*/
    axios.get("/product/selectDetailById"+location.search).then(function (response){
      v.p=response.data;
    })
  }
}
</script>

<style scoped>

</style>